package com.zmn.oms.zmn.business.impl.work;

import com.zmn.common.utils.date.DateUtil;
import com.zmn.oms.common.annotation.ZsNormalOrderWorkLog;
import com.zmn.oms.common.constant.OrderLogConsts;
import com.zmn.oms.model.dto.work.modify.must.OrderAssignConfirmDTO;
import com.zmn.oms.model.entity.work.OrderWork;
import com.zmn.oms.services.interfaces.work.OrderWorkService;
import com.zmn.oms.zmn.business.interfaces.work.OrderWorkAssignConfirmBService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * 类描述：服务商工单接单
 *
 * @author liuying
 * @date 2019/05/09 17:25
 */
@Service
public class OrderWorkAssignConfirmBServiceImpl implements OrderWorkAssignConfirmBService {

	@Autowired
	private OrderWorkService orderWorkService;

	@Override
	@Transactional(rollbackFor = Exception.class)
	@ZsNormalOrderWorkLog(type = OrderLogConsts.ORDER_LOG_TYPE_ASSIGN_CONFIRM)
	public void saveAssignConfirm(OrderAssignConfirmDTO orderAssignConfirmDTO) {
		OrderWork updateOrderWork = new OrderWork();
		updateOrderWork.setOrderId(orderAssignConfirmDTO.getOrderId());
		updateOrderWork.setWorkId(orderAssignConfirmDTO.getWorkId());
		updateOrderWork.setAssignConfirmerId(orderAssignConfirmDTO.getOperatorId());
		updateOrderWork.setAssignConfirmTime(DateUtil.getNow());
		orderWorkService.updateOrderWorkAssignConfirm(updateOrderWork);
	}
}
